package Homework2

import scala.beans.BeanProperty
import scala.io.StdIn

class User {
  @BeanProperty var name: String = "游客"
  @BeanProperty var choice: String = _
  @BeanProperty var win: Int = _
  @BeanProperty var draw: Int = _
  @BeanProperty var loss: Int = _

  def showFist(): Int = {
    StdIn.readInt() match {
      case 1 => println("你出拳：剪刀"); 1
      case 2 => println("你出拳：石头"); 2
      case 3 => println("你出拳：布"); 3
      case 3 => println("输入不符合规范，默认出布"); 3
    }
  }

  override def toString: String = {
    getName + " " + (getWin * 2 + getDraw) + " " + getWin + " " + getDraw + " " + getLoss
  }
}
